﻿
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using dbasyn;
using Serilog.Sinks.Loki;
using Serilog;


IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        
        services.AddHostedService<Worker>();
        LokiCredentials credentials = new NoAuthCredentials("http://pod1:3100");
        var Logger = new LoggerConfiguration()
            .WriteTo.LokiHttp(credentials, new LogLabelProvider())
            .CreateLogger();
        services.AddSingleton<ILogger>(Logger);
       
    })
    .Build();

await host.RunAsync();
